<?php

/**
 * sfGuardUserAdminForm for admin generators
 *
 * @package    sfDoctrineGuardPlugin
 * @subpackage form
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: sfGuardUserAdminForm.class.php 23536 2009-11-02 21:41:21Z Kris.Wallsmith $
 */
class sfGuardUserAdminForm extends BasesfGuardUserAdminForm
{
  /**
   * @see sfForm
   */
  public function configure()
  {
    unset(
    //  $this['is_active'],
      $this['is_super_admin'],
      $this['groups_list'],
      $this['created_at'],
      $this['updated_at'],
      $this['created_by'],
      $this['updated_by']
      
    );

    $this->getWidget('permissions_list')->setOption('multiple', false);

    #un usuario no puede deshabilitarse ni cambiar su propio perfil
    $sf_user=sfContext::getInstance()->getUser();
    if($this->getObject()->getId() == $sf_user->getGuardUser()->getId() ) {
       unset($this['is_active'], $this['permissions_list']);
    }

  }
}
